# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=beets
pkgver=1.6.0
pkgrel=2
pkgdesc="Music library manager and MusicBrainz tagger"
options="!check" # Requires unpackaged dependencies
url="https://beets.io"
arch="noarch"
license="MIT"
subpackages="$pkgname-doc $pkgname-zsh-completion"
depends="python3 py3-mutagen py3-unidecode py3-musicbrainzngs py3-munkres
	py3-yaml py3-jellyfish py3-mediafile py3-confuse py3-requests"
makedepends="py3-sphinx py3-setuptools"
source="https://github.com/sampsyo/beets/releases/download/v$pkgver/beets-$pkgver.tar.gz"

build() {
	# sdist := source distribution tarball, builds man pages
	python3 setup.py build sdist
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	local man
	for man in man/*.?; do
		install -Dm644 "$man" \
			"$pkgdir"/usr/share/man/man${man##*.}/${man##*/}
	done

	install -Dm644 extra/_beet -t "$pkgdir"/usr/share/zsh/site-functions/
}

sha512sums="
b03759a2be7d3318b4f43cac09ada229cea6496774ba3dcdb1458427e41f6329a627241afc0bfaa9a91afb6818ba944ef6088e38c5635a3bfe730a6a8011a0dc  beets-1.6.0.tar.gz
"
